package com.acme;

public class Account {

    private double balance;
    private double overdraft;

    public Account(final double amount, final double overdraft) {
        this.balance = amount;
        this.overdraft = overdraft;
    }

    public void withdraw(final double amount) {
        assert (this.balance + overdraft >0);
        if (this.balance + overdraft >= amount) {
            this.setBalance(this.balance - amount);
        } else {
            System.out.print("Not enough money!");
        }
    }

    public double maximumAmountToWithdraw(){
        return this.getBalance() + overdraft;
    }

    public double getBalance() {
        return balance;
    }

    protected void setBalance(double balance) {
        this.balance = balance;
    }

    public void deposit(final double amount){
        this.setBalance(this.balance + amount);
    }

}
